import createAxios, {getUrl} from '/@/utils/axios'
import {useUserInfo} from "/@/stores/userInfo";

export const apiUrl = '/api/ai.tool';

export function mind(params: any) {
    const userInfo = useUserInfo();
    return fetch(getUrl() + apiUrl + '/mind', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'Ba-User-Token': userInfo.token,
        },
        body: JSON.stringify(params)
    })
}

// 图片转代码
export function imageToCode(params: any) {
    const userInfo = useUserInfo();
    return fetch(getUrl() + apiUrl + '/imageToCode', {
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'Ba-User-Token': userInfo.token,
        },
        body: JSON.stringify(params)
    })
}
